<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>添加公司</title>
	<#include "./comm/meta-base.ftl" />
	<#include "./comm/meta-easyui.ftl" />
	<#include "./comm/meta-comm.ftl" />
</head>
<body>
		
<form id="data_form" role="form" class="page-form"   method="post" >
	<!--表单块-->
	<div class="form-title">编码生成器参数</div>
	<div class="row">
		<div class="form-group col-sm-12 ">
			<label class="col-sm-2 fm-label">编码生成器标识</label>
			<div class="col-sm-8 fm-control">
				<input type="text" name="keycodeId" id="keycodeId" value="${keycodeId}"
					class="form-control easyui-validatebox" data-options="required:true,validType:['length[0,64]']" />
			</div>
		</div>
	</div>
	<div class="row">
		<div class="form-group col-sm-12 ">
			<label class="col-sm-2 fm-label">自定义参数JSON</label>
			<div class="col-sm-10 fm-control">
				<textarea id="params" name="params" style="width:550px;height:200px;"></textarea>
			</div>
		</div>
	</div> 	
	<div class="row">
		
	</div>
	

	<div class="row">
		<div class="form-group col-sm-12 ">
			<label class="col-sm-2 fm-label">新编码</label>
			<div class="col-sm-8 fm-control">
				<input type="text" name="keycodeCurrentValue" id="keycodeCurrentValue" readonly="readonly"  class="form-control " />
			</div>
			<div class="col-sm-2">
				<a href="javascript:nextKeycode();" class="btn  btn-primary">下个编码值</a>
			</div>
		</div>
	</div>
	
	
	<!--表单操作按钮区-->
    <div class="but-row-bottom-shadow"></div>
    <div class="buts-row-bottom row ">
		<a href="javascript:closeWindow('编码生成器工具');" class="btn btn-default">
				<i class="fa fa-times"></i>取 消</a>
	</div>
	

</form>
</body>
</html>
<script type="text/javascript">

function nextKeycode(){
	if($("#data_form").form('validate')){//页面验证
		var keycodeId=$("#keycodeId").val();
		var params=$("#params").val();
		var jdata=null;
		if(null!=params&&""!=params){
			//jdata = $.parseJSON(params); 
			jdata = eval("(" + params + ")");
		}
		
		var url="${basePath}/keycode/keycode-next/"+keycodeId;
		$.ajax({ 
			url: url, 
			data: jdata, 
			success: function(sval){
	    		$("#keycodeCurrentValue").prop("value",sval);
			}
		});
	}
}
</script>


